<div class="personalinfo">
	<div class="mainnav">
		<div class="nav-li first">个人信息</div>
		{{#if !$Cache.personalinfo.is_edit}}
		<div value="true" class="nav-li" event-click="{{'$Event.personalinfo.to_edit'}}">修改</div>
		<!-- <a href="#personal/changepwd"><div class="nav-li">修改密码</div></a> -->
		{{#else}}
		<div value="true" class="nav-li" event-click="{{'$Event.personalinfo.post_edit'}}">完成</div>
		<div value="true" class="nav-li" event-click="{{'$Event.personalinfo.cancel_edit'}}">取消</div>
		{{/if}}
	</div>

	<div class="maintitle">当前位置：<span>个人信息</span></div>

	<div class="info_box">
		<div class="table">
			<div class="item">
				<div class="title">头像：</div>
				<span class="text"><img src="images/user-img.jpg"></span>
			</div>
			<div class="item">
				<div class="title">昵称：</div>
				<span class="text">{{loginer.info.name}}</span>
			</div>
		{{#if !$Cache.personalinfo.is_edit}}
			<div class="item">
				<div class="title">绑定手机：</div>
				<span class="text">{{loginer.info.mobile_phone}}</span>
			</div>
			<div class="item">
				<div class="title">绑定邮箱：</div>
				<span class="text">{{loginer.info.email}}</span>
			</div>
			<div class="item">
				<div class="title">身份证：</div>
				<span class="text">{{loginer.info.id_card}}</span>
			</div>
		{{#else}}
			<div class="item">
				<div class="title">绑定手机：</div>
				<span class="text"><input type="text" value="{{loginer.info.mobile_phone}}" bind-input="{{'loginer.info.mobile_phone'}}"></span>
			</div>
			<div class="item">
				<div class="title">绑定邮箱：</div>
				<span class="text"><input type="text" value="{{loginer.info.email}}" bind-input="{{'loginer.info.email'}}"></span>
			</div>
			<div class="item">
				<div class="title">身份证：</div>
				<span class="text"><input type="text" value="{{loginer.info.id_cart}}" bind-input="{{'loginer.info.id_cart'}}"></span>
			</div>
		{{/if}}
			
		</div>
	</div>
</div>

<xmp type="template" name="personalinfo.id_card">
	<span>{{$Private.id_card}}</span>
</xmp>
<script type="text/vm" name="personalinfo.id_card">
	function (vm) {
		vm.set("$Private.id_card",Model.Observer(function () {
			var id_card = vm.get("$This")||"";
			// console.log("id_card:",id_card);
			// 350623 199211 270018
			return id_card.substr(6)+"******"+id_card.substr(6);
		}));
		// debugger
		vm.model.onfollow = function () {
			debugger
			vm.get("$Private.id_card");
			vm.model.touchOff("$Private.id_card");
		}
	}
</script>